using System;
using System.Collections.Generic;
using System.Text;
using ImagesMath;

namespace Graphics.Geometries
{
    public class Plane : Form
    {

        public Plane(): base()
        {

        }

        public override bool FirstIntersection(ref Ray  ray,ref Intersection inter )
        {
            double Zo = ray.Origin.Z;  
            double Zd = ray.Direction.Z;

             if (Zd !=0)
                {
                 inter.T =  -(Zo) / (Zd);
                 if (inter.T > ImageMath.EPS) 
                    return true;
                 else 
                    return false;
                 } 
            else 
                 return false;	
        }


        public override VR3 Normal(PR3 p, ref Ray ray)
        {
            return new VR3(0,0,1);
        }
    }
}
